;;; org-mode.cfg.el --- Summary
;;; Commentary:
;;; org-mode configuration
;;; Code:

(use-package org
  :config
  ;; http://www.farseer.cn/tweak/2014/11/10/org-your-notes/
  (setq org-directory "~/docs/org")
  (unless (file-exists-p org-directory)
    (make-directory org-directory t))
  (setq org-log-done nil)
  (setq org-file-apps '((auto-mode . emacs24)
                        ("\\.mp4\\'" . "xdg-open %s")
                        ("\\.pdf\\'" . "xdg-open %s")))
  (setq org-startup-with-latex-preview)
  (setq org-startup-with-inline-images)

  :init
  (setq org-pretty-entities t)
  (add-hook 'org-mode-hook 'flyspell-mode)
  (add-hook 'org-mode-hook 'visual-line-mode)
  (add-hook 'org-mode-hook
            (lambda ()
              ;; Register " as verbatim
              ;; http://permalink.gmane.org/gmane.emacs.orgmode/82669
              (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\n,'")
              (custom-set-variables `(org-emphasis-alist ', org-emphasis-alist)))))

;; revealJS with org-mode
(package-install-if-absent 'ox-reveal)
(use-package ox-reveal
  :config
  (setq org-reveal-root "https://cdn.jsdelivr.net/reveal.js/3.0.0/"))

(provide 'org-mode.cfg)
;;; org-mode.cfg.el ends here
